package com.jg.poiet.excel.po;

import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.util.ArrayList;
import java.util.List;

public class IRow {

    private List<ICell> cellList = new ArrayList<>();

    public IRow(XSSFWorkbook workbook, XSSFSheet sheet, XSSFRow row) {
        if (row == null) {
            return ;
        }
        for (int i = 0; i <= row.getLastCellNum(); i++) {
            cellList.add(new ICell(workbook, sheet, row, row.getCell(i), i));
        }
    }

    public IRow(HSSFWorkbook workbook, HSSFSheet sheet, HSSFRow row) {
        if (row == null) {
            return ;
        }
        for (int i = 0; i <= row.getLastCellNum(); i++) {
            cellList.add(new ICell(workbook, sheet, row, row.getCell(i), i));
        }
    }

    public List<ICell> getCellList() {
        return cellList;
    }

    public void setCellList(List<ICell> cellList) {
        this.cellList = cellList;
    }
}
